﻿<%@ Page Title="Danh sách SmsMTType" Language="C#" MasterPageFile="~/App_MasterPages/Aquarius.Master"
    AutoEventWireup="true" CodeBehind="SmsMTTypeManagement.aspx.cs" Inherits="SMSROUTER.UI.SmsMTTypeManagement"  %>

<%@ Register Src="../UserControl/ucPaging.ascx" TagName="ucPaging" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CssContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            RegisterDialog();
        });

        function SetNew() {   
            ResetControl("pnl_dialog1");
            $("[id$=hdfAction]").val("AddNew");
            OpenDialog('dialog1', 600);
        }
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div class="row-fluid">
        <div class="span12">
            <div class="head">
                <div class="isw-grid">
                </div>
                <h1>Điều kiện tìm kiếm</h1>
                <div class="clear"></div>
            </div>
            <div class="block-fluid" style="padding: 10px 0px 5px 10px">
                <table width="100%" cellspacing="0" cellpadding="0" class="">
                    <tbody>
                        <tr>
                            <td style="width:150px">MT Type Code</td>
                            <td style="width:250px"><asp:TextBox ID="txtSearchMTTypeCode" runat="server"/></td>
                            <td style="width:150px">MT Type Name</td>
                            <td style="width:250px"><asp:TextBox ID="txtSearchMTTypeName" runat="server"/></td>
                        </tr>
                    </tbody>
                </table>
                <div style="text-align: center">
                    <asp:Button ID="btnSearch" runat="server" Text="Tìm kiếm" OnClick="btnSearch_Click"
                        CssClass="btn" />
                </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <div class="head">
                <div class="isw-grid"></div>
                <h1>Danh sách MT Type</h1>
                <ul class="buttons">
                    <li><a href="javascript:SetNew();" class="isw-plus" ID="lbtnAddNew" runat="server" title="Thêm mới dữ liệu" /></li>
                </ul>
                <div class="clear">
                </div>
            </div>
            <div class="block-fluid table-sorting">
                <div class="dataTables_wrapper" id="tSortable_wrapper">
                    <div class="dataTables_length">
                        <label>
                            Hiển thị
                            <asp:DropDownList ID="tSortable_length" size="1" aria-controls="tSortable" runat="server"
                                OnSelectedIndexChanged="tSortable_length_SelectedIndexChanged" AutoPostBack="true">
                                <asp:ListItem Value="50" Selected="True" />
                                <asp:ListItem Value="100" />
                                <asp:ListItem Value="200" />
                                <asp:ListItem Value="250" />
                                <asp:ListItem Value="300" />
                                <asp:ListItem Value="400" />
                                <asp:ListItem Value="500" />
                            </asp:DropDownList>
                            dòng</label>
                    </div>
                    <div>
                        <uc1:ucPaging ID="pagingtop" runat="server" />
                    </div>
                    <asp:GridView ID="grvData" CssClass="table2 dataTable" runat="server" 
                        AutoGenerateColumns="false" Width="100%" ShowHeaderWhenEmpty="true" onrowcommand="grvData_RowCommand">
                        <Columns>
                            <asp:TemplateField HeaderText="STT" ItemStyle-CssClass="STT">
                                <ItemTemplate>
                                    <%#(Container.DataItemIndex + 1) + (pagingtop.CurrentPage - 1) * pagingtop.PageSize%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="MT Type Code" DataField="MTTypeCode" />
                            <asp:BoundField HeaderText="MT Type Name" DataField="MTTypeName" />
                            <asp:CheckBoxField HeaderText="Enabled" DataField="Enabled" ItemStyle-CssClass="CheckBox"/>
                            <asp:TemplateField HeaderText="Chức năng" ItemStyle-CssClass="Function">
                                <ItemTemplate>
                                    <asp:LinkButton Text="Sửa" CommandArgument='<%#Eval("MTTypeID")%>' CommandName="Editing" runat="server" />
                                    &nbsp;
                                    <asp:LinkButton Text="Xóa" CommandArgument='<%#Eval("MTTypeID")%>' CommandName="Deleting" runat="server" OnClientClick="return confirm('Bạn có chắc chắn muốn xóa không?');"/>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <div class="dataTables_info" id="tSortable_info">
                        <asp:Literal ID="ltrInfo" runat="server" />
                    </div>
                    <div class="dataTables_paginate paging_full_numbers" id="tSortable_paginate">
                        <uc1:ucPaging ID="pagingbottom" runat="server" />
                    </div>
                </div>
                <div class="clear">
                </div>
            </div>
        </div>
    </div>
    <div class="dialog" id="dialog1" title="Thông tin MT Type" style="display: none;">
        <asp:Panel ID="pnl_dialog1" runat="server" CssClass="block">
            <asp:HiddenField ID="hdfID" Value="" runat="server" />
            <asp:HiddenField ID="hdfAction" Value="" runat="server" />
            <table width="100%" cellpadding="2" cellspacing="2" >
                <tr>
                    <td width="140px">MT Type Code</td>
                    <td><asp:TextBox ID="txtMTTypeCode" runat="server"/></td>
                    <td width="20px"><asp:RequiredFieldValidator ControlToValidate="txtMTTypeCode" Display="Dynamic" CssClass="validate" Text="(*)" ValidationGroup="GroupValidate" runat="server" /></td>
                </tr>
                <tr>
                    <td></td>
                    <td><asp:RegularExpressionValidator ID="RegularExpressionValidator" ValidationExpression="[\w+]{1,5}" ControlToValidate="txtMTTypeCode" Display="Dynamic" CssClass="validate" Text="Độ dài phải <= 5 ký tự" ValidationGroup="GroupValidate" runat="server" /></td>
                    <td></td>
                </tr>
                <tr>
                    <td>MT Type Name</td>
                    <td><asp:TextBox ID="txtMTTypeName" runat="server"/></td>
                    <td width="20px"><asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtMTTypeName" Display="Dynamic" CssClass="validate" Text="(*)" ValidationGroup="GroupValidate" runat="server" /></td>
                </tr>
                <tr>
                    <td></td>
                    <td><asp:RegularExpressionValidator ID="RegularExpressionValidator1" ValidationExpression="[\w+]{1,100}" ControlToValidate="txtMTTypeName" Display="Dynamic" CssClass="validate" Text="Độ dài phải <= 100 ký tự" ValidationGroup="GroupValidate" runat="server" /></td>
                    <td></td>
                </tr>
                <tr>
                    <td>Description</td>
                    <td><asp:TextBox ID="txtDescription" TextMode="MultiLine" runat="server"/></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td></td>
                    <td><asp:RegularExpressionValidator ID="RegularExpressionValidator2" ValidationExpression="[\w+]{1,2000}" ControlToValidate="txtDescription" Display="Dynamic" CssClass="validate" Text="Độ dài phải <= 2000 ký tự" ValidationGroup="GroupValidate" runat="server" /></td>
                    <td></td>
                </tr>
                <tr>
                    <td>Enable</td>
                    <td>
                        <asp:CheckBox ID="chkEnabled" runat="server"/>
                    </td>
                </tr>
            </table>
            <div style="text-align:center; width:100%; color:Red"><asp:Label ID="lbError" runat="server" EnableViewState="false"/></div>
        </asp:Panel>
        <div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
            <div class="ui-dialog-buttonset">
                <asp:Button ID="btnSave" CssClass="btn" runat="server" Text="Lưu" ValidationGroup="GroupValidate" onclick="btnSave_Click" />
                <input type="button" class="btn" value="Đóng" onclick="$('#dialog1').dialog('close'); return false;" />
            </div>
        </div>
    </div>
</asp:Content>
